<!--
 * @Author: 黄荣基
 * @Date: 2020-11-16 10:47:43
 * @LastEditors: 黄荣基
 * @LastEditTime: 2020-11-20 18:32:39
-->
<template>
  <div class="about">
    <div class="wrapper">
      <div class="page-main">
        <div class="form-wrapper">
          <div class="detail" v-html="content"></div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        content: ''
      };
    },
    mounted() {
      // 从sessionStorage缓存中获取post_id
      const id = sessionStorage.getItem('post_id');
      console.log(id);
      this.$toast.loading({
        message: '加载中...',
        forbidClick: true
      });
      // 调用接口
      this.$http.news.getNewsDetail(id).then(res => {
        this.$toast.clear();
        console.log(res);
        this.content = res.content;
      });
    }
  };
</script>
<style scoped>
  .detail {
    padding: 8px;
    text-align: left;
    font-size: 14px;
  }
  /* 对v-html中的内容 样式进行修改 */
  .detail >>> p {
    padding: 3px;
    text-align: left;
    line-height: 2;
  }
  .detail >>> strong {
    padding: 3px;
    text-align: left;
  }
</style>
